<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<table border="1">
    {% for list in lists %}
        {% if forloop.first %}
            <tr>
                <td>第1个值：{{ list.书名 }}</td>
            </tr>
        {% endif %}
        <tr>
            <td>当前值：{{ list.书名 }}，价格：{{ list.价格 }}，当前正序索引{{ forloop.counter0 }}，当前倒序索引{{ forloop.revcounter0 }}</td>
        </tr>
        {% if forloop.last %}
            <tr>
                <td>最后一个值：{{ list.书名 }}</td>
            </tr>
        {% endif %}
    {% endfor %}
</table>

</body>
</html>